﻿using SAO.Models;
using System;
using System.Collections.Generic;
using System.Text;

namespace SAO.OracleHelper.ValiDateModel
{
    [AttributeUsage(AttributeTargets.Property)]
    public class RequireAttribute : ValidateAttribute
    {
        public RequireAttribute(string propName) 
        {
            _PropName = propName;
        }
        public override ResultMsg Validate(object value)
        {
            ResultMsg resultMsg = new ResultMsg();
            if (value == null)
            {
                resultMsg.Msg = $"{_PropName}值不能为空";
            }
            return resultMsg;
        }
    }
}
